import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './common.css'
import $ from "jquery";
console.log('开始content-script.......')
setTimeout(()=>{ 
    const shopHeaderElements = $('[class^="ShopHeader--root"]');
    if (shopHeaderElements!= undefined && shopHeaderElements.length>0){
        const shopHeader = shopHeaderElements[0]
        const newDiv = $('<div>');
        newDiv.attr('id','taobao-helper')
        $(shopHeader).after(newDiv)
        Vue.use(ElementUI,{size:'small'});
        new Vue({
            el: '#taobao-helper',
            render: h => h(App)
        })
    }
    /*if (shopHeaderElements != undefined && shopHeaderElements.length>0) {
        console.log(shopHeaderElements)
        const shopHeaderElement = shopHeaderElements[0];
        const newDiv = document.createElement('div');
        newDiv.id = 'taobao-helper'

        newDiv.innerHTML = '<h1>hello</h1>';
        // shopHeaderElement.parentNode.insertBefore(newDiv, shopHeaderElement)
        shopHeaderElement.append(newDiv)
        Vue.use(ElementUI,{size:'small'});
        new Vue({
            el: '#taobao-helper',
            render: h => h(App)
        })
    } else {
        console.log('没找到........')
    }*/
},300)


